package com.yuqiangz.spring5.factorybean;

import com.yuqiangz.spring5.othertypeinject.Course;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author 赵雨强
 * @create 2021/7/20 8:36
 * @description 工厂bean,定义的类型和返回的类型不一致
 */
public class MyBean  implements FactoryBean<Course> {

    @Override
    public Course getObject() throws Exception {
        Course course = new Course();
        course.setCname("English");
        return course;
    }


    @Override
    public Class<?> getObjectType() {
        return null;
    }


    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
